package com.xk;

import com.xk.po.Student;
import com.xk.view.StudentView;
import com.xk.view.impl.StudentViewImpl;

import java.util.Scanner;

public class StudentEntry {
    public void work(){
        Scanner input = new Scanner(System.in);
        System.out.println("---------------------------------------------------------------------");
        System.out.println("|\t\t\t\t\t\t\t 学生选课系统 \t\t\t\t\t\t\t|");
        System.out.println("---------------------------------------------------------------------");

        StudentView studentView = new StudentViewImpl();
        Student student = studentView.login();
        if (student != null){
            int menu = 0;
            while (menu != 6){
                System.out.println("==== 1.查看课程信息；2.查看老师信息；3.查看已选课信息；4.选课；5.改密码；6.退出 ====");
                System.out.println("请输入你的选择：");
                menu = input.nextInt();
                switch (menu){
                    case 1:
                        studentView.listCourseAll();
                        break;
                    case 2:
                        studentView.listTeacherAll();
                        break;
                    case 3:
                        studentView.listTeachSome(student.getSid());
                        break;
                    case 4:
                        studentView.editTeach(student.getSid());
                        break;
                    case 5:
                        studentView.updateStudentByPassword(student.getSid());
                        break;
                    case 6:
                        System.out.println("选课结束！");
                        break;
                }
            }
        }
    }


    public static void main(String[] args) {
        new StudentEntry().work();
    }
}
